From 4730f5017499c1829f0f457afb84ab1d52d1f409 Mon Sep 17 00:00:00 2001 From: Ian Campbell Date: Thu, 28 Jun 2007 18:40:20 +0100 Subject: [PATCH] Fix fixup of invalid PTE writes, broken by 13392:0fd65225e4c6. By the time we test if addr is the upper word it has already been aligned to the 8 byte pte size. Signed-off-by: Ian Campbell --- xen/arch/x86/mm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c index c86a895819..29bfd5f878 100644 --- a/xen/arch/x86/mm.c +++ b/xen/arch/x86/mm.c @@ -3240,6 +3240,7 @@ static int ptwr_emulated_update( struct ptwr_emulate_ctxt *ptwr_ctxt) { unsigned long mfn; + unsigned long unaligned_addr = addr; struct page_info *page; l1_pgentry_t pte, ol1e, nl1e, *pl1e; struct vcpu *v = current; @@ -3294,7 +3295,7 @@ static int ptwr_emulated_update( if ( unlikely(!get_page_from_l1e(nl1e, d)) ) { if ( (CONFIG_PAGING_LEVELS >= 3) && is_pv_32bit_domain(d) && - (bytes == 4) && (addr & 4) && !do_cmpxchg && + (bytes == 4) && (unaligned_addr & 4) && !do_cmpxchg && (l1e_get_flags(nl1e) & _PAGE_PRESENT) ) { /* -- 2.30.2